package deployment

import (
	"github.com/gogf/gf/v2/frame/g"
)

// 获取服务器列表请求
//type DeploymentListReq struct {
//	g.Meta `path:"/deployment" method:"get" tags:"Deployment" summary:"获取服务器部署列表"`
//	// 设置代替参数和设置默认值
//	UserName string `param:"name" d:"张三"`
//	Password string `p:"pwd" d:"123456"`
//	Age      int
//}

/**
 * 获取服务器列表请求
 */
type DeploymentListReq struct {
	g.Meta    `path:"/deployment" method:"get" tags:"Deployment" summary:"获取服务器部署列表"`
	Page      int    `p:"page"      v:"min:1#页码最小为1"  dc:"页码"`
	Size      int    `p:"size"      v:"max:100#每页最多100条" dc:"每页数量"`
	ServerId  int    `p:"serverId"  dc:"服务器ID"`
	AppName   string `p:"appName"   dc:"应用名称"`
	StartTime string `p:"startTime" dc:"开始时间"`
	EndTime   string `p:"endTime"   dc:"结束时间"`
}

type DeploymentListRes struct {
	ServerId  int    `json:"server_id"  dc:"服务器ID"`
	AppName   string `json:"name"   dc:"应用名称"`
	StartTime string `json:"start_time" dc:"开始时间"`
	EndTime   string `json:"end_time"   dc:"结束时间"`
}

type DeploymentCreateInput struct {
	//*entity.Do.Deployment
	ConfigContent string `p:"configContent"`
}

//type DeploymentListOutput struct {
//	List  []*entity.DeploymentWithServer `json:"list"`
//	Total int                            `json:"total"`
//	Page  int                            `json:"page"`
//	Size  int                            `json:"size"`
//}

type DeploymentRollbackInput struct {
	Id     int    `p:"id" v:"required#记录ID不能为空"`
	Reason string `p:"reason" v:"required#回滚原因不能为空"`
}
